﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace Akabana.Amf.Messaging.Gateway.Service
{
    internal sealed class HttpHeaderHelper
    {
        
        private const string CONTENT_TYPE_AMF = "application/x-amf";
        private const string PRAGMA = "Pragma";
        private const string CACHE_CONTROL = "Cache-Control";
        private const string EXPIRES = "Expires";
        private const string NO_CACHE = "no-cache";
        private const string ZERO = "0";

        public static void setAmfContentType(HttpResponse response)
        {
            response.ContentType = CONTENT_TYPE_AMF;
        }

        public static void setCacheControl(HttpResponse response)
        {
            response.AddHeader(PRAGMA, NO_CACHE);
            response.AddHeader(CACHE_CONTROL, NO_CACHE);
            response.AddHeader(EXPIRES, ZERO);
        }
    }
}
